home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTake Digital Camera / QuickTake⁄Windows SDK / QTAKE-I.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-14  |  5.9 KB  |  157 lines  |  [TEXT/mdos]

  1. /*******************************************************************************
  2.  * QTAKE-I.H version 2.0
  3.  *
  4.  * Copyright Eastman Kodak Company, Inc. 1994 -1995, All Rights Reserved.
  5.  *******************************************************************************/
  6.  
  7. #ifndef __IMAGEPROCESSOR__
  8. #define __IMAGEPROCESSOR__
  9.  
  10. #ifdef __cplusplus
  11. extern "C" {            // Assume C declarations for C++ 
  12. #endif  // __cplusplus 
  13.  
  14. #include <Windows.h>
  15.  
  16. #define Boolean BOOL
  17. typedef short   OSErr;
  18. typedef OSErr (FAR PASCAL *IpProgressProcPtr)(  short msg,
  19.                                                 short percent,
  20.                                                 long refcon);
  21.  
  22. // IPM Error Codes
  23. #define ERROR_BASE                                          10000
  24. #define noErr                                               0
  25. #define kIpNoMemoryError                                    -620
  26. #define kIpAppCancel ERROR_BASE                           //10000
  27. #define kIpContextExistsError ERROR_BASE+1                //10001
  28. #define kIpNoContextExistsError ERROR_BASE+2              //10002
  29. #define kIpBadArgError ERROR_BASE+3                       //10003
  30. #define kIpCancel ERROR_BASE+4                            //10004
  31. #define kIpColorTablesNotCalculated ERROR_BASE+5          //10005
  32.  
  33.  
  34. // IPM Context Size 
  35. #define kIPMContextSize         24306                       //ipm context size. from 4096
  36. #define kIpDecompTableSize100   98                          //ADPCM=98
  37. #define kIpDecompTableSize150   174                         //RADC=174
  38.  
  39. #define kIpColorMatrixSize      3*4*sizeof(double)
  40.  
  41. // for progress callback (messages)
  42. #define IpProgressInit      0
  43. #define IpProgressUpdate    1
  44. #define IpProgressEnd       2
  45.  
  46. typedef enum rotateAngle {
  47.     kImgRot0 =0,    // 0 degree rotation
  48.     kImgRot90,      // 90 degree rotation
  49.     kImgRot180,     // 180 degree rotation
  50.     kImgRot270      // 270 degree rotation
  51. } RotateAngle;
  52.  
  53. typedef enum pixelType {// output image format
  54.     kGray8 = 0, // 8bit grayscale
  55.     kDIB24      // 24bit RGB "BMP"
  56. } kIpPixelType;
  57.  
  58.  
  59. typedef enum compression{   // Matches the Picture Info Compression Mode
  60.     kADPCM = 1,             // QT100 compression
  61.     kBitShiftA = 3,         // QT100 thumbnail compression
  62.     kRADC  = 4,             // QT150 compression
  63.     kBitShiftB = 5          // QT150 thumbnail compression
  64. } IpCompression;
  65.  
  66. typedef struct xyChroma {
  67.     double xChroma;
  68.     double yChroma;
  69. } XYChroma;
  70.  
  71. typedef struct characteristics {// CRT display characteristics
  72.     XYChroma redChroma;         // Red phospher chromaticities
  73.     XYChroma greenChroma;       // Green phospher chromaticities
  74.     XYChroma blueChroma;        // Blue phospher chromaticities
  75.     double gamma;               // CRT color temprature, in Kelvins
  76. } Characteristics;
  77.  
  78. typedef struct imageAttribute{  
  79.     unsigned short aImgWidth;           // Horizontal size of image,in pixels
  80.     unsigned short aImgLength;          // Vertical size of image, in pixels
  81.     IpCompression aCompressionType;     // Compression Type of image
  82.     kIpPixelType aPixelType;            // Color or Grey; bits per pixel
  83.     RotateAngle aAngle;                 // Rotation angle of output image
  84.     unsigned short aStartingLine;       // Start line number of output band
  85.     unsigned short aLinesPerBand;       // Number of full width lines in band
  86.     Boolean firstBand;                  // Set to TRUE for first band of an image
  87.     Boolean lastBand;                   // Set to TRUE to free working buffers
  88. } ImageAttribute;
  89.  
  90. typedef struct progressCallBack {
  91.     IpProgressProcPtr   callBackProc;   //Application progress callback proc
  92.     long            refcon;     //Reference constant
  93. } ProgressCallBack;
  94.  
  95. // Prototype declarations
  96. OSErr FAR PASCAL IpInitIPM(unsigned char far * ipm);
  97.  
  98. OSErr FAR PASCAL IpEndIPM(unsigned char far * ipm);
  99.  
  100. OSErr FAR PASCAL IpConvertThumbnailToRGB(   
  101.                         unsigned char far * ipm,
  102.                         unsigned char far * pCompedTNail,
  103.                         unsigned char far * pTNailRGB,
  104.                         ImageAttribute far *imgAttr);
  105.  
  106. OSErr FAR PASCAL IpConvertImageToRGB(   
  107.                     unsigned char far *     ipm,
  108.                     unsigned char huge *    pCompedCDI,
  109.                     unsigned char huge *    pRGB,
  110.                     ImageAttribute far *    imgAttr,
  111.                     ProgressCallBack far *  CallBackProc);
  112.  
  113. OSErr FAR PASCAL IpGetDisplayCharacteristics(
  114.                     unsigned char far *     ipm,
  115.                     Characteristics far *   characteristics);
  116.  
  117. OSErr FAR PASCAL IpSetDisplayCharacteristics(
  118.                     unsigned char far *     ipm,
  119.                     Characteristics far *   characteristics);
  120.  
  121. OSErr FAR PASCAL IpInitDisplayCharacteristics(unsigned char far * ipm);
  122.  
  123. OSErr FAR PASCAL IpGetCameraColorMatrix(
  124.                         unsigned char far * ipm,
  125.                         double far *        cameraMatrix);
  126.  
  127. OSErr FAR PASCAL IpSetCameraColorMatrix(
  128.                         unsigned char far *     ipm,
  129.                         double far *            cameraMatrix);
  130.  
  131. OSErr FAR PASCAL IpInitCameraColorMatrix(unsigned char far * ipm);
  132.  
  133.  
  134. OSErr FAR PASCAL IpGetCompressionTable( 
  135.                         unsigned char far * ipm,
  136.                         IpCompression       compType,
  137.                         unsigned char far * decompTable);
  138.  
  139. OSErr FAR PASCAL IpSetCompressionTable(
  140.                         unsigned char far * ipm,
  141.                         IpCompression       compType,
  142.                         unsigned char far * decompTable);
  143.  
  144. OSErr FAR PASCAL IpInitCompressionTable(
  145.                         unsigned char far * ipm,
  146.                         IpCompression       compType);
  147. //
  148.  
  149. OSErr FAR PASCAL IpCalculateColorTables(unsigned char far * ipm);
  150.  
  151. #ifdef __cplusplus
  152. }                       /* End of extern "C" { */
  153. #endif  /* __cplusplus */
  154.  
  155. #endif /* __IMAGEPROCESSOR__ */
  156.  
  157.